#break   - 循环中执行了break，退出循环

# n=0
# while n<100:
#     n+=1
#     print(n)  
#     if n==4:
#         break

# print("n=",n)  

#continue - 循环中执行continue,这次循环剩下的语句不再执行，继续下一次循环判断

# n=0
# while n<100:
#     n+=1

#     if n==4:
#         continue 
#         # break
    
#     print(n) 
# else:
#     print("-----------")   
    

# print("n=",n)  

'''
练习
#计算100以内的奇数的和
'''
# n=1
# sum=0
# while n<100:
#     if n%2==1:
#         sum+=n 
#     n+=1
# else:
#     # print("sum:",sum) 
#     print("sum:"+str(sum))  

# 使用cotinue完成计算100以内的奇数的和
n=0
sum=0
while n<100:
    n+=1

    if n%2==0:
        continue
    
    sum+=n 
else:
    print("sum:",sum)






